# coding=utf-8

from web import form

from form import Email, EmailValidator

login_form = form.Form(
        # 邮箱
        Email('email'
            , EmailValidator()
            , description = '邮箱'
            , class_ = 'inp'
            , required = 'required'
            , tabindex = 1),
        # 密码
        form.Password('pwd'
            , form.regexp('^(.+)$', '请输入密码。')
            , description = '密码'
            , class_ = 'inp'
            , required = 'required'
            , tabindex = 2),
        # 记住
        form.Checkbox('remeber'
            , description = '记住登录状态'
            , class_ = 'chk'
            , tabindex = 3),
        # 成功后跳转的地址
        form.Hidden('url'),
        )

subscribe_form = form.Form(
        # 订阅Email
        Email('email'
            , EmailValidator()
            , description = 'Email'
            , class_ = 'inp'
            , required = 'required'
            , tabindex = 1),
        # 省市
        form.Dropdown('depart'
            , form.notnull
            , description = '省/市'
            , required = 'required'
            , tabindex = 2),
        )
